{% extends 'layout.html' %}}
{% block main %}
<li id="category">
    <a href="/admin/category">分类管理</a>
    <ul class="dropdown">
        <li><a href="javascript:;">管理首页</a></li>
        <li><a href="/admin/category/add">添加分类</a></li>
    </ul>
</li>
<script>
    $('#category').hover(function(){
        $(this).find('.dropdown').stop().slideDown(400);
    },function(){
        $(this).find('.dropdown').stop().slideUp(400);
    });
</script>
<h3>分类列表</h3>
<table class="users-list">
    <thead>
    <tr>
        <th>id</th>
        <th>分类名</th>
        <th>备注</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    {% for category in data %}
    <tr>
        <td>{{category._id.toString()}}</td>
        <td>{{category.name}}</td>
        <td>
            <a href="/admin/category/edit">修改 </a>
            |<a href="/admin/category/edit"> 删除</a>
        </td>
        <td></td>
    </tr>
    {% endfor %}
    </tbody>
</table>
{%include 'page.html'%}
{% endblock %}